<?php
use LSYS\Area\IP;
use LSYS\APIServer\ResultFail;
use LSYS\APIServer\ResultSucc;
use LSYS\APIServer\Param;
include_once __DIR__."/Bootstarp.php";
//通过IP解析地址
$param=Param::factory($_GET);
$ip=$param->get("ip",IP::client_ip(),Param::TYPE_STRING_TRIM);
$data=IP::instance()->find_addr($ip);
list($code,$area,$addr,$detail)=$data;
if (!$addr)out_json(ResultFail::factory($detail));
else out_json(ResultSucc::factory($data));